{% extends "common/layout_main.html" %}
{% block content %}
    {% include 'common/tab_food.html' %}
    <div class="row">
        <div class="col-lg-12">
            <form class="form-inline wrap_search">
                <div class="row  m-t p-w-m">
                    {% include 'common/search_status.html' %}
                </div>
                <hr>
                <div class="row">
                    <div class="col-lg-12">
                        <a class="btn btn-w-m btn-outline btn-primary pull-right"
                           href="{{ buildUrl('/food/cat-set') }}">
                            <i class="fa fa-plus"></i>分类
                        </a>
                    </div>
                </div>
            </form>
            <table class="table table-bordered m-t">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>分类名称</th>
                    <th>状态</th>
                    <th>权重</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {% if food_cat_list %}
                    {% for food_cat in food_cat_list %}
                        <tr>
                            <td>{{ loop.index }}</td>
                            <td>{{ food_cat.name }}</td>
                            <td>{{ food_cat.status_desc }}</td>
                            <td>{{ food_cat.weight }}</td>
                            <td>
                                {% if food_cat.status == 1 %}
                                    <a class="m-l" href="{{ buildUrl('/food/cat-set') }}?id={{ food_cat.id }}">
                                        <i class="fa fa-edit fa-lg"></i>
                                    </a>
                                {% endif %}
                                {% if food_cat.status == 1 %}
                                    <a class="m-l remove" href="javascript:void(0);" data="{{ food_cat.id }}">
                                        <i class="fa fa-trash fa-lg"></i>
                                    </a>
                                {% else %}
                                    <a class="m-l recover" href="javascript:void(0);" data="{{ food_cat.id }}">
                                        <i class="fa fa-refresh fa-lg"></i>
                                    </a>
                                {% endif %}
                            </td>
                        </tr>
                    {% endfor %}
                {% else %}
                    <tr>
                        <td colspan="5">暂无数据</td>
                    </tr>
                {% endif %}
                </tbody>
            </table>
        </div>
    </div>
{% endblock %}
{% block js %}
    <script src="{{ buildStaticUrl('/js/food/cat_ops.js') }}"></script>
{% endblock %}
